package io.framework.modules.water.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.framework.common.service.impl.CrudServiceImpl;
import io.framework.modules.water.dao.WaterFractureSurfaceDao;
import io.framework.modules.water.dto.WaterFractureSurfaceDTO;
import io.framework.modules.water.entity.WaterFractureSurfaceEntity;
import io.framework.modules.water.service.WaterFractureSurfaceService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 地表水 监测断面水质评价表
 *
 * @author Gujq email
 * @since 1.0.0 2020-05-22
 */
@Service
public class WaterFractureSurfaceServiceImpl extends CrudServiceImpl<WaterFractureSurfaceDao, WaterFractureSurfaceEntity, WaterFractureSurfaceDTO> implements WaterFractureSurfaceService {

    @Override
    public QueryWrapper<WaterFractureSurfaceEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<WaterFractureSurfaceEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }

    @Override
    public void deleteInfoByDate(String year) {
        baseDao.deleteInfoByDate(year);
    }
}